package org.example.service.impl;

import org.example.mapper.TargetMapper;
import org.example.pojo.Target;
import org.example.service.TargetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: Edward
 * @Date:2022-08-31 10:46
 * @subject:
 */
@Service
public class TargetServiceImpl implements TargetService {

    //调用Mapper接口
    @Autowired
    private TargetMapper targetMapper;

    public void setTargetMapper(TargetMapper targetMapper){
        this.targetMapper = targetMapper;
    }

    @Override
    public boolean addTarget(Target target) {
        return targetMapper.addTarget(target);
    }

    @Override
    public boolean updateTarget(Target target) {
        return targetMapper.updateTarget(target);
    }

    @Override
    public Target selectById(Integer tId) {
        return targetMapper.selectById(tId);
    }

    @Override
    public List<Target> showAllTarget() {
        return targetMapper.showAllTarget();
    }

    @Override
    public List<Target> selectTargetByName(String tName) {
        return targetMapper.selectTargetByName(tName);
    }

    @Override
    public boolean deleteTargetById(Integer tId) {
        return targetMapper.deleteTargetById(tId);
    }
}
